<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>筛选人脉 - 社交圈</title>
    <!-- Bootstrap 5 CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome 图标 -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
    
    <style>
        :root {
            --primary: #4338ca;
            --primary-light: #6366f1;
            --primary-dark: #312e81;
            --secondary: #be185d;
            --success: #15803d;
            --warning: #d97706;
            --danger: #dc2626;
            --text-primary: #1e293b;
            --text-secondary: #64748b;
            --bg-light: #f1f5f9;
            --bg-white: #ffffff;
            --border-light: #e2e8f0;
            --radius: 10px;
            --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        }
        
        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
            background-color: var(--bg-light);
            color: var(--text-primary);
            padding-top: 56px;
            padding-bottom: 60px;
        }
        
        /* 顶部导航 */
        .top-nav {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            height: 56px;
            background-color: var(--bg-white);
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 16px;
            z-index: 1000;
            border-bottom: 1px solid var(--border-light);
        }
        
        .nav-title {
            font-size: 1.1rem;
            font-weight: 600;
        }
        
        .nav-action {
            color: var(--text-secondary);
            background: none;
            border: none;
            font-size: 1.2rem;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .nav-action:hover {
            background-color: var(--bg-light);
        }
        
        .nav-action.primary {
            color: var(--primary);
        }
        
        /* 搜索栏 */
        .search-container {
            padding: 12px 16px;
            background-color: var(--bg-white);
            border-bottom: 1px solid var(--border-light);
        }
        
        .search-box {
            position: relative;
        }
        
        .search-input {
            width: 100%;
            padding: 10px 16px 10px 40px;
            border-radius: 30px;
            border: 1px solid var(--border-light);
            font-size: 0.9rem;
            background-color: var(--bg-light);
        }
        
        .search-input:focus {
            outline: none;
            border-color: var(--primary-light);
            box-shadow: 0 0 0 2px rgba(67, 56, 202, 0.1);
        }
        
        .search-icon {
            position: absolute;
            left: 14px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-secondary);
            font-size: 0.95rem;
        }
        
        /* 筛选面板切换 */
        .filter-toggle {
            display: flex;
            background-color: var(--bg-white);
            border-bottom: 1px solid var(--border-light);
        }
        
        .toggle-tab {
            flex: 1;
            padding: 14px 0;
            text-align: center;
            font-size: 0.95rem;
            font-weight: 500;
            color: var(--text-secondary);
            position: relative;
        }
        
        .toggle-tab.active {
            color: var(--primary);
        }
        
        .toggle-tab.active::after {
            content: '';
            position: absolute;
            bottom: -1px;
            left: 0;
            right: 0;
            height: 2px;
            background-color: var(--primary);
        }
        
        /* 筛选面板 */
        .filter-panels {
            background-color: var(--bg-white);
            border-bottom: 1px solid var(--border-light);
            overflow: hidden;
        }
        
        .filter-panel {
            padding: 16px;
            display: none;
            animation: slideIn 0.3s ease;
        }
        
        .filter-panel.active {
            display: block;
        }
        
        @keyframes slideIn {
            from { transform: translateY(10px); opacity: 0; }
            to { transform: translateY(0); opacity: 1; }
        }
        
        .filter-section {
            margin-bottom: 20px;
        }
        
        .filter-title {
            font-size: 0.95rem;
            font-weight: 600;
            margin-bottom: 12px;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        
        .filter-title i {
            color: var(--primary);
        }
        
        /* 标签筛选样式 */
        .tags-filter {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-bottom: 16px;
        }
        
        .filter-tag {
            padding: 6px 14px;
            background-color: var(--bg-light);
            border-radius: 20px;
            font-size: 0.85rem;
            white-space: nowrap;
            color: var(--text-primary);
            border: 1px solid var(--border-light);
        }
        
        .filter-tag.active {
            background-color: var(--primary);
            color: white;
            border-color: var(--primary);
        }
        
        /* 范围筛选样式 */
        .range-slider {
            width: 100%;
            margin: 15px 0;
        }
        
        .range-labels {
            display: flex;
            justify-content: space-between;
            font-size: 0.8rem;
            color: var(--text-secondary);
        }
        
        /* 复选框筛选样式 */
        .checkbox-group {
            display: flex;
            flex-wrap: wrap;
            gap: 12px;
        }
        
        .checkbox-item {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 0.85rem;
        }
        
        .form-check-input:checked {
            background-color: var(--primary);
            border-color: var(--primary);
        }
        
        /* 按钮筛选组 */
        .button-group {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }
        
        .filter-button {
            padding: 6px 14px;
            background-color: var(--bg-light);
            border-radius: 20px;
            font-size: 0.85rem;
            color: var(--text-primary);
            border: 1px solid var(--border-light);
        }
        
        .filter-button.active {
            background-color: var(--primary);
            color: white;
            border-color: var(--primary);
        }
        
        /* 筛选操作栏 */
        .filter-actions {
            display: flex;
            gap: 10px;
            padding: 12px 16px;
            background-color: var(--bg-white);
            border-bottom: 1px solid var(--border-light);
        }
        
        .reset-btn {
            flex: 1;
            padding: 10px;
            border-radius: 8px;
            font-size: 0.9rem;
            font-weight: 500;
            background-color: var(--bg-light);
            color: var(--text-primary);
            border: 1px solid var(--border-light);
        }
        
        .apply-btn {
            flex: 2;
            padding: 10px;
            border-radius: 8px;
            font-size: 0.9rem;
            font-weight: 500;
            background-color: var(--primary);
            color: white;
            border: none;
        }
        
        /* 结果统计 */
        .results-stats {
            padding: 12px 16px;
            background-color: var(--bg-white);
            border-bottom: 1px solid var(--border-light);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .stats-text {
            font-size: 0.9rem;
            color: var(--text-secondary);
        }
        
        .sort-options {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 0.85rem;
        }
        
        .sort-option {
            color: var(--text-secondary);
        }
        
        .sort-option.active {
            color: var(--primary);
            font-weight: 500;
        }
        
        /* 交友列表容器 */
        .friendship-container {
            padding: 12px 16px;
        }
        
        /* 交友卡片样式 */
        .friend-card {
            background-color: var(--bg-white);
            border-radius: var(--radius);
            padding: 16px;
            margin-bottom: 14px;
            box-shadow: var(--shadow);
            transition: all 0.2s ease;
            border: 1px solid var(--border-light);
        }
        
        .friend-card:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        }
        
        .card-header {
            display: flex;
            justify-content: space-between;
            margin-bottom: 12px;
        }
        
        .person-info {
            display: flex;
            align-items: center;
            gap: 12px;
        }
        
        .person-avatar {
            width: 64px;
            height: 64px;
            border-radius: 50%;
            object-fit: cover;
            position: relative;
        }
        
        .avatar-status {
            position: absolute;
            bottom: 0;
            right: 0;
            width: 20px;
            height: 20px;
            border-radius: 50%;
            background-color: var(--bg-white);
            border: 2px solid var(--bg-white);
        }
        
        .status-online {
            background-color: var(--success);
        }
        
        .avatar-placeholder {
            width: 64px;
            height: 64px;
            border-radius: 50%;
            background-color: var(--bg-light);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.5rem;
            color: var(--text-secondary);
            border: 1px solid var(--border-light);
        }
        
        .person-details {
            min-width: 0;
        }
        
        .person-name {
            font-weight: 600;
            font-size: 1rem;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        
        .name-badge {
            font-size: 0.7rem;
            padding: 1px 6px;
            border-radius: 10px;
            background-color: rgba(67, 56, 202, 0.1);
            color: var(--primary);
        }
        
        .person-meta {
            font-size: 0.8rem;
            color: var(--text-secondary);
            margin-top: 3px;
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }
        
        .connection-tag {
            font-size: 0.75rem;
            color: var(--secondary);
            background-color: rgba(190, 24, 93, 0.1);
            padding: 2px 8px;
            border-radius: 10px;
            display: inline-block;
            margin-top: 4px;
        }
        
        /* 卡片操作按钮 */
        .card-actions {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }
        
        .action-btn {
            padding: 6px 12px;
            border-radius: 8px;
            font-size: 0.85rem;
            font-weight: 500;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
        }
        
        .primary-btn {
            background-color: var(--primary);
            color: white;
            border: none;
        }
        
        .secondary-btn {
            background-color: var(--bg-light);
            color: var(--text-primary);
            border: 1px solid var(--border-light);
        }
        
        /* 内容区域 - 图片样式 */
        .media-content {
            margin: 12px 0;
        }
        
        .media-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 8px;
        }
        
        .media-item {
            aspect-ratio: 1;
            border-radius: 8px;
            overflow: hidden;
        }
        
        .media-image {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        
        /* 个人简介 */
        .intro-text {
            font-size: 0.85rem;
            line-height: 1.5;
            color: var(--text-primary);
            margin: 10px 0;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }
        
        /* 共同兴趣/好友 */
        .common-info {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 0.8rem;
            color: var(--text-secondary);
            margin: 8px 0;
        }
        
        /* 无图样式卡片 */
        .no-media .media-content {
            display: none;
        }
        
        /* 底部导航 */
        .bottom-nav {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            height: 60px;
            background-color: var(--bg-white);
            display: flex;
            justify-content: space-around;
            align-items: center;
            border-top: 1px solid var(--border-light);
            z-index: 1000;
        }
        
        .nav-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            color: var(--text-secondary);
            font-size: 0.7rem;
            gap: 4px;
            flex: 1;
            height: 100%;
        }
        
        .nav-item.active {
            color: var(--primary);
        }
        
        .nav-icon {
            font-size: 1.2rem;
        }
        
        /* 加载更多 */
        .load-more {
            padding: 15px 0;
            text-align: center;
            font-size: 0.9rem;
            color: var(--primary);
        }
        
        /* 提示消息 */
        .toast {
            position: fixed;
            bottom: 80px;
            left: 50%;
            transform: translateX(-50%);
            background-color: rgba(0, 0, 0, 0.7);
            color: white;
            padding: 8px 16px;
            border-radius: 4px;
            z-index: 9999;
            font-size: 0.85rem;
            opacity: 0;
            transition: opacity 0.3s ease;
        }
        
        .toast.show {
            opacity: 1;
        }
    </style>
</head>
<body>
    <!-- 顶部导航 -->
    <div class="top-nav">
        <button class="nav-action" id="backBtn">
            <i class="fas fa-arrow-left"></i>
        </button>
        <div class="nav-title">筛选人脉</div>
        <button class="nav-action primary" id="saveFilterBtn">
            <i class="fas fa-bookmark"></i>
        </button>
    </div>
    
    <!-- 搜索栏 -->
    <div class="search-container">
        <div class="search-box">
            <i class="fas fa-search search-icon"></i>
            <input type="text" class="search-input" placeholder="搜索感兴趣的人...">
        </div>
    </div>
    
    <!-- 筛选面板切换 -->
    <div class="filter-toggle">
        <div class="toggle-tab active" data-panel="basic">基本筛选</div>
        <div class="toggle-tab" data-panel="advanced">高级筛选</div>
        <div class="toggle-tab" data-panel="social">社交筛选</div>
    </div>
    
    <!-- 筛选面板 -->
    <div class="filter-panels">
        <!-- 基本筛选面板 -->
        <div class="filter-panel active" id="basic-panel">
            <div class="filter-section">
                <div class="filter-title">
                    <i class="fas fa-user"></i> 性别
                </div>
                <div class="button-group">
                    <button class="filter-button active">全部</button>
                    <button class="filter-button">男</button>
                    <button class="filter-button">女</button>
                </div>
            </div>
            
            <div class="filter-section">
                <div class="filter-title">
                    <i class="fas fa-calendar"></i> 年龄范围
                </div>
                <input type="range" min="18" max="60" value="30" class="form-range range-slider" id="ageRange">
                <div class="range-labels">
                    <span>18岁</span>
                    <span id="ageValue">18-30岁</span>
                    <span>60岁</span>
                </div>
            </div>
            
            <div class="filter-section">
                <div class="filter-title">
                    <i class="fas fa-map-marker-alt"></i> 距离范围
                </div>
                <input type="range" min="1" max="100" value="20" class="form-range range-slider" id="distanceRange">
                <div class="range-labels">
                    <span>1km</span>
                    <span id="distanceValue">20km以内</span>
                    <span>100km</span>
                </div>
            </div>
            
            <div class="filter-section">
                <div class="filter-title">
                    <i class="fas fa-graduation-cap"></i> 学历
                </div>
                <div class="checkbox-group">
                    <label class="checkbox-item">
                        <input type="checkbox" class="form-check-input"> 高中及以下
                    </label>
                    <label class="checkbox-item">
                        <input type="checkbox" class="form-check-input" checked> 大专
                    </label>
                    <label class="checkbox-item">
                        <input type="checkbox" class="form-check-input" checked> 本科
                    </label>
                    <label class="checkbox-item">
                        <input type="checkbox" class="form-check-input"> 硕士
                    </label>
                    <label class="checkbox-item">
                        <input type="checkbox" class="form-check-input"> 博士及以上
                    </label>
                </div>
            </div>
        </div>
        
        <!-- 高级筛选面板 -->
        <div class="filter-panel" id="advanced-panel">
            <div class="filter-section">
                <div class="filter-title">
                    <i class="fas fa-briefcase"></i> 职业类型
                </div>
                <div class="tags-filter">
                    <div class="filter-tag active">全部</div>
                    <div class="filter-tag">互联网/IT</div>
                    <div class="filter-tag">金融</div>
                    <div class="filter-tag">教育</div>
                    <div class="filter-tag">医疗</div>
                    <div class="filter-tag">艺术/设计</div>
                    <div class="filter-tag">学生</div>
                    <div class="filter-tag">自由职业</div>
                </div>
            </div>
            
            <div class="filter-section">
                <div class="filter-title">
                    <i class="fas fa-heart"></i> 兴趣爱好
                </div>
                <div class="tags-filter">
                    <div class="filter-tag">音乐</div>
                    <div class="filter-tag active">摄影</div>
                    <div class="filter-tag active">旅行</div>
                    <div class="filter-tag">运动</div>
                    <div class="filter-tag">阅读</div>
                    <div class="filter-tag">美食</div>
                    <div class="filter-tag">电影</div>
                    <div class="filter-tag">游戏</div>
                    <div class="filter-tag">健身</div>
                    <div class="filter-tag">宠物</div>
                </div>
            </div>
            
            <div class="filter-section">
                <div class="filter-title">
                    <i class="fas fa-ring"></i> 情感状态
                </div>
                <div class="button-group">
                    <button class="filter-button active">全部</button>
                    <button class="filter-button">单身</button>
                    <button class="filter-button">恋爱中</button>
                    <button class="filter-button">已婚</button>
                </div>
            </div>
            
            <div class="filter-section">
                <div class="filter-title">
                    <i class="fas fa-language"></i> 语言能力
                </div>
                <div class="checkbox-group">
                    <label class="checkbox-item">
                        <input type="checkbox" class="form-check-input" checked> 中文
                    </label>
                    <label class="checkbox-item">
                        <input type="checkbox" class="form-check-input"> 英语
                    </label>
                    <label class="checkbox-item">
                        <input type="checkbox" class="form-check-input"> 日语
                    </label>
                    <label class="checkbox-item">
                        <input type="checkbox" class="form-check-input"> 韩语
                    </label>
                    <label class="checkbox-item">
                        <input type="checkbox" class="form-check-input"> 法语
                    </label>
                </div>
            </div>
        </div>
        
        <!-- 社交筛选面板 -->
        <div class="filter-panel" id="social-panel">
            <div class="filter-section">
                <div class="filter-title">
                    <i class="fas fa-users"></i> 共同好友
                </div>
                <div class="button-group">
                    <button class="filter-button active">全部</button>
                    <button class="filter-button">1人以上</button>
                    <button class="filter-button">3人以上</button>
                    <button class="filter-button">5人以上</button>
                </div>
            </div>
            
            <div class="filter-section">
                <div class="filter-title">
                    <i class="fas fa-clock"></i> 活跃时间
                </div>
                <div class="tags-filter">
                    <div class="filter-tag active">全部</div>
                    <div class="filter-tag">今天活跃</div>
                    <div class="filter-tag">3天内活跃</div>
                    <div class="filter-tag">1周内活跃</div>
                    <div class="filter-tag">1个月内活跃</div>
                </div>
            </div>
            
            <div class="filter-section">
                <div class="filter-title">
                    <i class="fas fa-id-card"></i> 认证状态
                </div>
                <div class="checkbox-group">
                    <label class="checkbox-item">
                        <input type="checkbox" class="form-check-input" checked> 实名认证
                    </label>
                    <label class="checkbox-item">
                        <input type="checkbox" class="form-check-input"> 学历认证
                    </label>
                    <label class="checkbox-item">
                        <input type="checkbox" class="form-check-input"> 职业认证
                    </label>
                    <label class="checkbox-item">
                        <input type="checkbox" class="form-check-input"> 视频认证
                    </label>
                </div>
            </div>
            
            <div class="filter-section">
                <div class="filter-title">
                    <i class="fas fa-sort"></i> 社交热度
                </div>
                <div class="button-group">
                    <button class="filter-button active">不限</button>
                    <button class="filter-button">高热度</button>
                    <button class="filter-button">中等热度</button>
                    <button class="filter-button">新用户</button>
                </div>
            </div>
        </div>
    </div>
    
    <!-- 筛选操作栏 -->
    <div class="filter-actions">
        <button class="reset-btn" id="resetBtn">重置筛选</button>
        <button class="apply-btn" id="applyBtn">应用筛选 (128)</button>
    </div>
    
    <!-- 结果统计 -->
    <div class="results-stats">
        <div class="stats-text">找到 128 位符合条件的用户</div>
        <div class="sort-options">
            <span class="sort-option active">推荐优先</span>
            <span class="sort-option">距离最近</span>
            <span class="sort-option">最新加入</span>
        </div>
    </div>
    
    <!-- 交友列表容器 -->
    <div class="friendship-container">
        <!-- 1. 多图样式卡片 -->
        <div class="friend-card">
            <div class="card-header">
                <div class="person-info">
                    <div>
                        <img src="https://picsum.photos/id/64/200/200" alt="陈佳琪" class="person-avatar">
                        <div class="avatar-status status-online"></div>
                    </div>
                    <div class="person-details">
                        <div class="person-name">
                            陈佳琪 
                            <i class="fas fa-female" style="color: #be185d; font-size: 0.8rem;"></i>
                            <span class="name-badge">设计师</span>
                        </div>
                        <div class="person-meta">
                            <span>27岁</span>
                            <span>3.2km</span>
                            <span>本科</span>
                        </div>
                        <span class="connection-tag">12个共同好友</span>
                    </div>
                </div>
                <div class="card-actions">
                    <button class="action-btn primary-btn">
                        <i class="fas fa-user-plus"></i> 加好友
                    </button>
                </div>
            </div>
            
            <p class="intro-text">
                热爱生活的UI设计师，喜欢摄影和旅行，期待认识有趣的朋友一起探索城市美好。
            </p>
            
            <div class="common-info">
                <i class="fas fa-tag"></i>
                <span>匹配兴趣：摄影、旅行</span>
            </div>
            
            <div class="media-content">
                <div class="media-grid">
                    <div class="media-item">
                        <img src="https://picsum.photos/id/112/300/300" alt="照片1" class="media-image">
                    </div>
                    <div class="media-item">
                        <img src="https://picsum.photos/id/119/300/300" alt="照片2" class="media-image">
                    </div>
                    <div class="media-item">
                        <img src="https://picsum.photos/id/133/300/300" alt="照片3" class="media-image">
                    </div>
                </div>
            </div>
        </div>
        
        <!-- 2. 无图样式卡片 -->
        <div class="friend-card no-media">
            <div class="card-header">
                <div class="person-info">
                    <div>
                        <img src="https://picsum.photos/id/91/200/200" alt="李明" class="person-avatar">
                    </div>
                    <div class="person-details">
                        <div class="person-name">
                            李明 
                            <i class="fas fa-male" style="color: #3b82f6; font-size: 0.8rem;"></i>
                            <span class="name-badge">摄影师</span>
                        </div>
                        <div class="person-meta">
                            <span>31岁</span>
                            <span>8.5km</span>
                            <span>本科</span>
                        </div>
                        <span class="connection-tag">5个共同好友</span>
                    </div>
                </div>
                <div class="card-actions">
                    <button class="action-btn primary-btn">
                        <i class="fas fa-user-plus"></i> 加好友
                    </button>
                </div>
            </div>
            
            <p class="intro-text">
                自由摄影师，擅长风光和人像摄影，经常组织摄影采风活动，希望认识更多摄影爱好者。
            </p>
            
            <div class="common-info">
                <i class="fas fa-tag"></i>
                <span>匹配兴趣：摄影、旅行</span>
            </div>
        </div>
        
        <!-- 3. 无头像样式卡片 -->
        <div class="friend-card no-media">
            <div class="card-header">
                <div class="person-info">
                    <div class="avatar-placeholder">
                        <i class="fas fa-user"></i>
                    </div>
                    <div class="person-details">
                        <div class="person-name">
                            张雯 
                            <i class="fas fa-female" style="color: #be185d; font-size: 0.8rem;"></i>
                            <span class="name-badge">旅行博主</span>
                        </div>
                        <div class="person-meta">
                            <span>29岁</span>
                            <span>15km</span>
                            <span>硕士</span>
                        </div>
                        <span class="connection-tag">3个共同好友</span>
                    </div>
                </div>
                <div class="card-actions">
                    <button class="action-btn secondary-btn">
                        <i class="fas fa-envelope"></i> 发消息
                    </button>
                    <button class="action-btn primary-btn">
                        <i class="fas fa-user-plus"></i> 加好友
                    </button>
                </div>
            </div>
            
            <p class="intro-text">
                职业旅行博主，每年有一半时间在路上，分享各地美景和人文故事，寻找旅伴一起探索世界。
            </p>
            
            <div class="common-info">
                <i class="fas fa-tag"></i>
                <span>匹配兴趣：旅行、摄影</span>
            </div>
        </div>
        
        <!-- 加载更多 -->
        <div class="load-more">
            <span>加载更多符合条件的人脉</span>
        </div>
    </div>
    
    <!-- 底部导航 -->
    <div class="bottom-nav">
        <div class="nav-item">
            <i class="fas fa-home nav-icon"></i>
            <span>首页</span>
        </div>
        <div class="nav-item active">
            <i class="fas fa-compass nav-icon"></i>
            <span>发现</span>
        </div>
        <div class="nav-item">
            <i class="fas fa-users nav-icon"></i>
            <span>人脉</span>
        </div>
        <div class="nav-item">
            <i class="fas fa-bell nav-icon"></i>
            <span>通知</span>
        </div>
        <div class="nav-item">
            <i class="fas fa-user nav-icon"></i>
            <span>我的</span>
        </div>
    </div>
    
    <!-- 提示消息元素 -->
    <div class="toast" id="toast"></div>
    
    <!-- Bootstrap JS Bundle with Popper -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
    
    <script>
        // 筛选面板切换
        document.querySelectorAll('.toggle-tab').forEach(tab => {
            tab.addEventListener('click', function() {
                // 切换标签激活状态
                document.querySelectorAll('.toggle-tab').forEach(t => t.classList.remove('active'));
                this.classList.add('active');
                
                // 切换面板显示
                const panelId = this.getAttribute('data-panel') + '-panel';
                document.querySelectorAll('.filter-panel').forEach(panel => {
                    panel.classList.remove('active');
                });
                document.getElementById(panelId).classList.add('active');
            });
        });
        
        // 年龄范围滑块
        const ageRange = document.getElementById('ageRange');
        const ageValue = document.getElementById('ageValue');
        
        ageRange.addEventListener('input', function() {
            ageValue.textContent = `18-${this.value}岁`;
            updateResultCount();
        });
        
        // 距离范围滑块
        const distanceRange = document.getElementById('distanceRange');
        const distanceValue = document.getElementById('distanceValue');
        
        distanceRange.addEventListener('input', function() {
            distanceValue.textContent = `${this.value}km以内`;
            updateResultCount();
        });
        
        // 标签筛选切换
        document.querySelectorAll('.filter-tag').forEach(tag => {
            tag.addEventListener('click', function() {
                // 如果是"全部"标签，取消其他标签的选中状态
                if (this.textContent === '全部') {
                    this.parentElement.querySelectorAll('.filter-tag').forEach(t => {
                        t.classList.remove('active');
                    });
                    this.classList.add('active');
                } else {
                    // 如果点击其他标签，取消"全部"的选中状态
                    const allTag = this.parentElement.querySelector('.filter-tag:first-child');
                    if (allTag && allTag.textContent === '全部') {
                        allTag.classList.remove('active');
                    }
                    
                    // 切换当前标签状态
                    this.classList.toggle('active');
                }
                
                updateResultCount();
            });
        });
        
        // 按钮筛选切换
        document.querySelectorAll('.filter-button').forEach(button => {
            button.addEventListener('click', function() {
                // 同一组按钮只能选中一个
                this.parentElement.querySelectorAll('.filter-button').forEach(btn => {
                    btn.classList.remove('active');
                });
                this.classList.add('active');
                updateResultCount();
            });
        });
        
        // 复选框筛选变化
        document.querySelectorAll('.form-check-input').forEach(checkbox => {
            checkbox.addEventListener('change', function() {
                updateResultCount();
            });
        });
        
        // 排序选项切换
        document.querySelectorAll('.sort-option').forEach(option => {
            option.addEventListener('click', function() {
                document.querySelectorAll('.sort-option').forEach(opt => opt.classList.remove('active'));
                this.classList.add('active');
                showToast(`已按${this.textContent}排序`);
            });
        });
        
        // 重置筛选按钮
        document.getElementById('resetBtn').addEventListener('click', function() {
            // 重置滑块
            ageRange.value = 30;
            ageValue.textContent = '18-30岁';
            distanceRange.value = 20;
            distanceValue.textContent = '20km以内';
            
            // 重置标签筛选
            document.querySelectorAll('.filter-tag').forEach(tag => {
                if (tag.textContent === '全部') {
                    tag.classList.add('active');
                } else {
                    tag.classList.remove('active');
                }
            });
            
            // 重置按钮筛选
            document.querySelectorAll('.filter-button').forEach(button => {
                if (button.textContent === '全部' || button.textContent === '不限') {
                    button.classList.add('active');
                } else {
                    button.classList.remove('active');
                }
            });
            
            // 重置复选框
            document.querySelectorAll('.form-check-input').forEach(checkbox => {
                checkbox.checked = false;
            });
            
            // 勾选默认复选框
            document.querySelectorAll('.form-check-input')[1].checked = true; // 大专
            document.querySelectorAll('.form-check-input')[2].checked = true; // 本科
            document.querySelectorAll('.form-check-input')[6].checked = true; // 中文
            document.querySelectorAll('.form-check-input')[10].checked = true; // 实名认证
            
            updateResultCount();
            showToast('已重置所有筛选条件');
        });
        
        // 应用筛选按钮
        document.getElementById('applyBtn').addEventListener('click', function() {
            showToast('筛选条件已应用');
            // 滚动到结果列表
            document.querySelector('.friendship-container').scrollIntoView({
                behavior: 'smooth'
            });
        });
        
        // 保存筛选条件
        document.getElementById('saveFilterBtn').addEventListener('click', function() {
            showToast('筛选条件已保存');
        });
        
        // 返回按钮
        document.getElementById('backBtn').addEventListener('click', function() {
            history.back();
        });
        
        // 更新结果数量
        function updateResultCount() {
            // 模拟计算符合条件的用户数量
            const baseCount = 128;
            const randomFactor = Math.floor(Math.random() * 15) - 7; // -7到+7之间的随机数
            const newCount = Math.max(5, baseCount + randomFactor);
            
            document.getElementById('applyBtn').textContent = `应用筛选 (${newCount})`;
            document.querySelector('.stats-text').textContent = `找到 ${newCount} 位符合条件的用户`;
        }
        
        // 加好友按钮
        document.querySelectorAll('.action-btn.primary-btn').forEach(btn => {
            btn.addEventListener('click', function() {
                const userName = this.closest('.friend-card').querySelector('.person-name').textContent.trim().split(' ')[0];
                this.innerHTML = '<i class="fas fa-check"></i> 已发送';
                this.disabled = true;
                showToast(`好友请求已发送给 ${userName}`);
            });
        });
        
        // 发消息按钮
        document.querySelectorAll('.action-btn.secondary-btn').forEach(btn => {
            btn.addEventListener('click', function() {
                const userName = this.closest('.friend-card').querySelector('.person-name').textContent.trim().split(' ')[0];
                showToast(`开始与 ${userName} 聊天`);
            });
        });
        
        // 提示消息功能
        function showToast(message) {
            const toast = document.getElementById('toast');
            toast.textContent = message;
            toast.classList.add('show');
            
            setTimeout(() => {
                toast.classList.remove('show');
            }, 2000);
        }
    </script>
</body>
</html>

